<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02属性操作</title>
</head>
<body>
<div id="demo" class="test" title="测试">测试</div>
</body>
<script>
    var demo = document.getElementById("demo");
    console.log(demo.getAttribute("class"));//获取属性
    demo.setAttribute("class","show");  //设置节点
    demo.removeAttribute("title");  //删除节点
</script>
</html>